package demo1;

public class Test {

    public static void test1(Animal animal){
        animal.eat();
    }
    public static void test2(IFlying iFlying){
        iFlying.fly();
    }
    public static void test3(IRunning iRunning){
        iRunning.run();
    }

    public static void test4(ISwimming iSwimming){
        iSwimming.swim();
    }

    public static void main(String[] args) {
        Dog dog = new Dog("小狗",5);
        Brid brid = new Brid("小鸟",3);

        //test2(dog);
        test2(brid);
        System.out.println("======");

        test3(dog);
        test3(brid);
        System.out.println("======");

        test4(dog);
        //test4(brid);

        Robot robot =new Robot();
        test3(robot);
    }

    public static void main1(String[] args) {
        Dog dog = new Dog("小狗",5);
        Brid brid = new Brid("小鸟",3);

        test1(dog);
        test1(brid);
    }
}
